package com.dsteiner.xelavos.client.rpc;

import java.util.List;

import com.dsteiner.widgets.client.domain.DataRequest;
import com.dsteiner.widgets.client.domain.Distinct;
import com.dsteiner.widgets.client.rpc.BaseDataService;
import com.dsteiner.widgets.client.rpc.CrudResult;
import com.dsteiner.widgets.client.rpc.SearchRequest;
import com.dsteiner.xelavos.client.domain.DataResult;
import com.dsteiner.xelavos.client.domain.SearchInfo;
import com.dsteiner.xelavos.client.domain.User;
import com.dsteiner.xelavos.client.domain.UserStats;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("data")
public interface DataService extends BaseDataService {
	
	public static class Util {
		private static DataServiceAsync instance;
		public static DataServiceAsync getInstance(){
			if (instance == null) {
				instance = (DataServiceAsync) GWT.create(DataService.class);
			}
			return instance;
		}
	}

	CrudResult<User> getUser(String email, String password);

	DataResult getData(List<DataRequest> dataRequests);
	
	UserStats getUserStats();
	
	void clearCache();

	String sendPassword(String email);

	void sendConfirmationMail(User user);
	
	String sendMessage(String fromUserId, String toUserId, String message);

	SearchInfo getSearchInfo(SearchRequest searchRequest);

	CrudResult<User> updatePassword(User user, String password);
}
